package com.jade.bss.db;

import com.jade.bss.DbException;
import com.jade.framework.base.criterion.Criteria;
import com.jade.framework.base.util.PagingList;
import com.jade.framework.base.util.PagingResult;

import java.util.List;

/**
 * 零售生态体系--智慧销售篇
 * User: JinYa 2009_jinya@163.com
 * Date: 2016-4-17
 * Time: 14:07
 * Version : 1.0
 * Remark:
 * History:
 */
public interface BaseFacade {
     <T> void delete(Class<T> clazz, Object id) throws DbException;

     <T> void delete(Class<T> clazz, Object[] ids) throws DbException;

     <T> List<T> getAll(Class<T> clazz) throws DbException;

     <T> T getById(Class<T> clazz, Object id)throws DbException;

     <T> List<T> getByIds(Class<T> clazz, Object[] ids)throws DbException;

     void save(Object entity) throws DbException;

     <T> void batchSave(List<T> entitys) throws DbException;

     void update(Object entity) throws DbException;

     <T> PagingList<T> queryEntity(Class<T> entityClass, Criteria criteria) throws DbException;

     <T> PagingList<T> queryEntity(Class<T> entityClass, Object entity,int page,int size) throws DbException;

     <T> PagingList<T> queryEntity(Class<T> entityClass, Object entity,int page,int size,String key) throws DbException;

     PagingResult queryEntity(Object entity,int page,int size,String keys,String... orders) throws DbException,IllegalAccessException, InstantiationException;
}
